package com.tianma.upload.uploadjartest.socket.demo01;

import java.io.IOException;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

/**
 * @author lgc
 * @createDate 2020/8/17 - 11:33
 */
public class SocketTest {
    public static void main(String[] args) throws IOException {
        InetAddress byName = InetAddress.getByName("127.0.0.1");
        Socket socket = new Socket(byName,8888);
        OutputStream outputStream = socket.getOutputStream();
        outputStream.write("你好呀！我是超过".getBytes());
        outputStream.close();
        socket.close();
    }
}
